package com.czxy.dao;

import com.czxy.pojo.Sku;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

/**
 * SkuMapper 类
 * @author 刘韵琴  email:17674029449@163.com
 * @date 2018/12/25 9:52
 */

@org.apache.ibatis.annotations.Mapper
public interface SkuMapper extends Mapper<Sku> {

    /**
     * 查询sku的销量
     * @param skuId
     * @return Integer
     */
    @Select("select count(*) from tb_order_good og,tb_order o  where og.sku_id = #{skuId} and og.sn = o.sn and o.status>=4")
    public Integer findSellCountBySkuId(Integer skuId);
}